<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="common/include :: header"></head>
<body class="gray-bg">
<div class="wrapper wrapper-content ">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox">
                <div class="ibox-body">
                    <div class="fixed-table-toolbar">
                        <div class="columns pull-left">
                            <button shiro:hasPermission="/role/add" type="button" class="btn btn-primary" onclick="add()">
                                <i class="fa fa-plus" aria-hidden="true"></i>添加
                            </button>
                            <button shiro:hasPermission="/role/edit" type="button" class="btn btn-success" onclick="edit()">
                                <i class="fa fa-edit" aria-hidden="true"></i>修改
                            </button>
                            <button shiro:hasPermission="/role/del" type="button" class="btn btn-danger" onclick="del()">
                                <i class="fa fa-trash" aria-hidden="true"></i>删除
                            </button>
                            <button shiro:hasPermission="/role/setUpPower" type="button" class="btn btn-info" onclick="setUpPower()">
                                <i class="fa fa-balance-scale" aria-hidden="true"></i>权限设置
                            </button>
                        </div>
                        <div class="columns pull-right">
                            <button type="button" class="btn btn-success" onclick="find()">
                                <i class="fa fa-search"></i>查询
                            </button>
                        </div>

                        <div class="columns pull-right col-md-2 nopadding">
                            <input id="searchName" type="text" class="form-control" placeholder="角色名称">
                        </div>
                    </div>
                    <table id="roleTable" data-mobile-responsive="true">
                    </table>
                </div>
            </div>
        </div>
    </div>

    <!--表格行内按钮权限设置-->
    <div>
        <script type="text/javascript">
            var editFlag = 'hidden';
            var delFlag = 'hidden';
            var powerFlag = 'hidden';
        </script>
    </div>
    <div shiro:hasPermission="/role/edit">
        <script type="text/javascript">
            editFlag = '';
        </script>
    </div>
    <div shiro:hasPermission="/role/del">
        <script type="text/javascript">
            delFlag = '';
        </script>
    </div>
    <div shiro:hasPermission="/role/setUpPower">
        <script type="text/javascript">
            powerFlag = '';
        </script>
    </div>
    <!--表格行内按钮权限设置-->
</div>
<div th:include="common/include :: footer"></div>
<script type="text/javascript" th:src="@{/project/role/role.js}"></script>
</body>
</html>